<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	session.setAttribute("basePath", basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<base href="${basePath }">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
<meta name="renderer" content="webkit">
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>订单打印</title>
<link rel="stylesheet" href="css/pintuer.css">
<!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<style type="text/css">
body {
	max-width: 720px;
}

@media print {
	hr {
		height: 1px;
	}
}
</style>

</head>

<body>
	<c:forEach items="${complexOrderList }" var="co" varStatus="coStat">
		<div class="container margin-top margin-bottom" style="padding-left: 0px;padding-right: 0px;">

			<div class="line">
				<div class="xl3 xs4 xm5"></div>
				<div class="xl6 xs4 xm2text-center">
					<img src="${shopSession.shopPicture }" class="img-responsive" alt="" />
				</div>
				<div class="xl3 xs4 xm5"></div>
			</div>
			<div class="line">
				<div class="xl0"></div>
				<div class="xl12 text-left">
					<p class="margin-little">收&nbsp;&nbsp;货&nbsp;&nbsp;人：${co.order.orderBuyerName}</p>
					<p class="margin-little">联系方式：${co.order.orderBuyerPhone}</p>
					<p class="margin-little">
						订购日期：
						<fmt:formatDate value="${co.order.orderBuyTime }" pattern="yyyy-MM-dd" />
					</p>
					<p class="margin-little">付款方式：货到付款</p>
					<p class="margin-little">订&nbsp;&nbsp;单&nbsp;&nbsp;号：${co.order.orderId }</p>
					<p class="margin-little">收货地址：${co.order.orderBuyerAddress}</p>
				</div>
				<div class="xl0"></div>
			</div>
			<hr>
			<div class="line">
				<div class="xl3">
					<strong>商品名</strong>
				</div>
				<div class="xl3">
					<strong>单价</strong>
				</div>
				<div class="xl3">
					<strong>数量</strong>
				</div>
				<div class="xl3">
					<strong>金额</strong>
				</div>
			</div>
			<c:forEach items="${co.goodsHistoryItemList}" var="goodsHistoryItem" varStatus="giStat">
				<hr>
				<p>${goodsHistoryItem.goodsHistory.goodsName }</p>
				<div class="line">
					<div class="xl3"></div>
					<div class="xl3">
						<fmt:formatNumber value="${goodsHistoryItem.goodsHistory.goodsPrice }" type="currency" pattern="#,##0.##" />
					</div>
					<div class="xl3">${goodsHistoryItem.number }</div>
					<div class="xl3">
						<fmt:formatNumber value="${goodsHistoryItem.goodsHistory.goodsPrice*goodsHistoryItem.number }" type="currency" pattern="#,##0.##" />
					</div>
				</div>
			</c:forEach>
			<hr>
			<p class="text-right">
				合计：<strong><fmt:formatNumber value="${co.order.orderTotalPrice }" type="currency" pattern="#,##0.##" /></strong> 元
			</p>
			<hr>
			<p class="margin-little text-center">妥善保管好购物凭证</p>
			<p class="margin-little text-center">欢迎下次光临！</p>
			<c:if test="${fn:length(complexOrderList)!=coStat.count}">
				<div style="height: 1px; background: black; width: 100%; margin: 20px 0px;"></div>
			</c:if>
		</div>
	</c:forEach>
	<!-- jQuery -->
	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<!-- pintuer -->
	<script type="text/javascript" src="js/pintuer.js"></script>
	<script type="text/javascript">
		$(function()
		{
			window.print();
		});
	</script>
</body>
</html>
